package com.pic.others.mapper;

import com.pic.others.domain.dto.picture.PictureWithCategoryDTO;
import com.pic.others.domain.po.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author koshi
 * @since 2023-11-24
 */
public interface CategoryMapper extends BaseMapper<Category> {

    // 根据父节点，找出他的下一级子目录节点
    List<Category> getCategoriesByFatherNodeId(@Param("fatherId") long fatherId,
                                               @Param("userId") long userId);

    // 根据子节点找出，子节点是这个的种类
    List<Category> getCategoriesByChildNodeId(@Param("childId") long childId,
                                              @Param("userId") long userId);

    //找出最小的子节点
    List<Category>getCategoriesByUserId(@Param("userId")long userId);





    List<Category> getCategoryPictueByFatherId(@Param("userId") Long userId,@Param("categoryId") Long categoryId);

    List<Category> getFatherCategory();


    List<Long> getFatherCategoryByUserId(Long userId);
}
